<%@page contentType="text/html; charset=utf-8"%>
<%@ include file="/commons/taglibs.jsp"%>
<%@ include file="/commons/commonEdit.jsp"%>
<%@ include file="/commons/tabs.jsp"%>
<%@ taglib uri="http://www.myce.net.cn/ce-tag" prefix="ce"%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title></title>
<script type="text/javascript"
	src="${ctx}/scripts/tags/unitedselect/UnitedSelect.js"></script>
<script language="JavaScript" src="${ctx}/scripts/common/prototype.js"></script>
<script type="text/javascript" src="${ctx}/scripts/common.js"></script>
<script type="text/javascript">
	var ACTION_URL="${ctx}/charge_charStoChoAction.do?";

	//常规费用
	function openNewGenneral(){
		var url=ACTION_URL + "method=initAddGenneralCho";
		top.windowOpen(url, 'addPage', '${key.addGeneralCharge}', 500, 800, true, "addPageIframe");
	}

	//修改常规费用
	function openEditGenneral(){
		if( getSelectedRecordID() != "" ){
			var url=ACTION_URL + "method=initEditGenneralCho&keyword="+getSelectedRecordID();
			top.windowOpen(url, 'editPage', '${key.editGeneralCharge}', 200, 800,true, "editPageIframe");
		}else{
			ErrorAlert('${key.tipsByModify}');
		}
	}

	//走表费用
	function openNewMeter(){
		var url=ACTION_URL + "method=initAddMeterCho";
		top.windowOpen(url, 'addPage', '${key.addMeterCharge}', 500, 800, true, "addPageIframe");
	}

	//修改走表费用
	function openEditMeter(){
		if( getSelectedRecordID() != "" ){
			var url=ACTION_URL + "method=initEditMeterCho&keyword="+getSelectedRecordID();
			top.windowOpen(url, 'editPage', '${key.editMeterCharge}', 200, 800,true, "editPageIframe");
		}else{
			ErrorAlert('${key.tipsByModify}');
		}
	}

	//固定费用
	function openNewFixed(){
		var url=ACTION_URL + "method=initAddFixedCho";
		top.windowOpen(url, 'addPage', '${key.addFixedCharge}', 570, 800, true, "addPageIframe");
	}

	//修改固定费用
	function openEditFixed(){
		if( getSelectedRecordID() != "" ){
			var url=ACTION_URL + "method=initEditFixedCho&keyword="+getSelectedRecordID();
			top.windowOpen(url, 'editPage', '${key.editFixedCharge}', 240, 800,true, "editPageIframe");
		}else{
			ErrorAlert('${key.tipsByModify}');
		}
	}

	//弹出删除提示窗口
	function showDelete(){
		if( getSelectedRecordID() == "" ){
			ErrorAlert('${key.tipsByDelete}');
		}else{
			AlarmConfirm('${key.tipsByDeleteConfirm}',"main","deleteRecord");
		}
	}
	//执行删除
	function deleteRecord(){
		var url=ACTION_URL + "method=delete&keyword="+getSelectedRecordID();
		var myAjax = new Ajax.Request(
	                   url,
	                   {method: 'post', parameters:"" , onComplete: showResponseDelete}
	                   );
	}
	//删除响应
	function showResponseDelete(transport){
		ajaxSubmitException(transport.responseText);
		if(transport.responseText=="false"){
			FailureAlert('${key.doFalse}');
		}else{
			reLoadIFrameListWithQuery();
		}
	}

	//获取当前选择的记录
	function getSelectedRecordID(){
		return window.frames("charStoChoList").selectedRecordID;
	}

	//重新加载列表页面,不保留条件的刷新
	function reLoadIFrameList(){
		var url= $('fsearch').action + "&ec_s_sysDate=DESC";
		$('charStoChoList').src=url;
	}

	//重新加载列表页面,保留查询条件的刷新
	function reLoadIFrameListWithQuery(){
		window.frames("charStoChoList").freshFrame();
	}


	function changeMethodName(methodName){
		$('fsearch').action=ACTION_URL+"method="+methodName;
		if(methodName=="queryMeterChoList"){
			$('generalChargeItemID').style.display="none";
			$('meterChargeItemID').style.display="";
			$('fixedChargeItemID').style.display="none";

			$('generalChargeItemID').name="generalChargeItemID";
			$('meterChargeItemID').name="chargeItemID";
			$('fixedChargeItemID').name="fixedChargeItemID";
		}else if(methodName=="queryFixedChoList"){
			$('generalChargeItemID').style.display="none";
			$('fixedChargeItemID').style.display="";
			$('meterChargeItemID').style.display="none";

			$('generalChargeItemID').name="generalChargeItemID";
			$('meterChargeItemID').name="meterChargeItemID";
			$('fixedChargeItemID').name="chargeItemID";
		}else if(methodName=="queryGenneralChoList"){
			$('generalChargeItemID').style.display="";
			$('meterChargeItemID').style.display="none";
			$('fixedChargeItemID').style.display="none";

			$('generalChargeItemID').name="chargeItemID";
			$('meterChargeItemID').name="meterChargeItemID";
			$('fixedChargeItemID').name="fixedChargeItemID";
		}
	}

	function search(){
		$('fsearch').submit();
	}

	function clearSearch(){
		$('fsearch').reset();
	}

	function init(){
		$('fsearch').action=ACTION_URL+"method=queryGenneralChoList";
	}

	function onSelect(thiz)
	{
		selectId = thiz.options[thiz.selectedIndex].value;
		var url =ACTION_URL+"method=unitedSelect&selectId="+selectId+"&targetId=chargeStaID";
		onChangeSelect(url,selectId,'chargeStaID');
	}
</script>
</head>
<body onload="init();">

<form id="fsearch" action="" target="charStoChoList" method="post">
<!--style="display:none"-->
<div class="pageNav_bg">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
	<tr>
		<td id="pageNav_leftimg"><img src="${ctx}/images/ico_fc_fajianbiaozhu.gif"
			width="46" height="47" /></td>
		<td id="navWord"><span class="page_title">${key.houseStaCho}</span></td>
		<td class="pageNav_right"><a href="javascript:showFull_in();"><img
			id="full_image" src="${ctx}/images/ico_fullscreen.gif" border="0" /></a></td>
	</tr>
</table>
</div>
<div class="container">
<table width="100%" border="0" cellpadding="0" cellspacing="0">
	<tr>
		<td><!-----------------------------搜索1----------------------------->
		<table width="100%" border="0" cellpadding="0" cellspacing="0"
			id="search01" class="bg_search">
			<tr>
				<td>
				<table border="0" cellpadding="0" cellspacing="1">
					<tr>

						<td class="td_search">${key.building }：</td>
						<td class="td_search"><ce:unitedSelect
							dataList="${buildingList}" id="buildingID" name="buildingID"
							optionLabel="name" optionValue="keyword"
							selectText="${key.pleaseSelect}" tabIndex="3">
						</ce:unitedSelect></td>
						<td class="td_search">${key.houseNumber }：</td>
						<td class="td_search"><input name="houseNumber" type="text"
							class="inputtext" size="16" /></td>

						<td class="td_search">${key.chareItem}：</td>
						<td class="td_search">
						<pms:unitedSelect id="generalChargeItemID"
							name="chargeItemID" actionName="" targetId="chargeStaID"
							dataList="${generalChargeItemList}" optionLabel="itemName"
							optionValue="keyword" onChange="onSelect(this)"
							selectText="${key.pleaseSelect}" className="required" style="display: ;">
						</pms:unitedSelect>

						<pms:unitedSelect id="meterChargeItemID"
							name="meterChargeItemID" actionName="" targetId="chargeStaID"
							dataList="${meterChargeItemList}" optionLabel="itemName"
							optionValue="keyword" onChange="onSelect(this)"
							selectText="${key.pleaseSelect}" className="required" style="display: none;">
						</pms:unitedSelect>

						<pms:unitedSelect id="fixedChargeItemID"
							name="fixedChargeItemID" actionName="" targetId="chargeStaID"
							dataList="${fixChargeItemList}" optionLabel="itemName"
							optionValue="keyword" onChange="onSelect(this)"
							selectText="${key.pleaseSelect}" className="required" style="display: none;">
						</pms:unitedSelect>

						</td>
						<td class="td_search">${key.chargeSta}：</td>
						<td class="td_search"><pms:unitedSelect id="chargeStaID"
							name="chargeStaID" selectText="${key.pleaseSelect}"
							className="required">
						</pms:unitedSelect></td>
						<td class="td_search">
						<table border="0" cellpadding="0" cellspacing="0">
							<tr>
								<td class="buttonOffLeft" id="btn1_11"></td>
								<td class="buttonOffMiddle" id="btn1_12" onblur="btn_change(1)"
									onMouseOver="btn_change_over(1)" onMouseOut="btn_change_out(1)"
									onclick="search();"><img
									src="${ctx}/images/ico_searchico.gif" alt="" border="0"
									align="absmiddle" /> ${key.search}</td>
								<td class="buttonOffRight" id="btn1_13"></td>
							</tr>
						</table>
						</td>
						<td>
						<table border="0" cellpadding="0" cellspacing="0">

						</table>
						</td>
					</tr>
				</table>
				</td>
			</tr>
		</table>
		</td>
	</tr>
	<tr>


		<td width="35%" align="right">
		<!--------------------------右边图标01----------------------------------->
		<div id="rightGeneral" style="display:none">
		<table border="0" cellpadding="0" cellspacing="0" id="ico1">
			<tr><pms:AuthTag authName="charge_charStoChoAction.do?method=initAddGenneralCho">
				<td class="toolbarico"><a href="#" onClick="openNewGenneral();"
					onFocus="this.blur()"><img src="${ctx}/images/ico_newfile.gif"
					border="0" align="absbottom" alt="${key.add}" /></a></td>
			</pms:AuthTag>
			<pms:AuthTag authName="charge_charStoChoAction.do?method=initEditGenneralCho">
				<td class="toolbarico"><a href="#" onClick="openEditGenneral()"
					onFocus="this.blur()"><img src="${ctx}/images/ico_amend.gif"
					border="0" align="absbottom" alt="${key.modify}" /></a></td>
				</pms:AuthTag>
				<pms:AuthTag authName="button.nopage.common.selectChangeStandenSelect.one">
				<td class="toolbarico"><a href="#" onClick="showDelete();"
					onFocus="this.blur()"><img src="${ctx}/images/ico_delete.gif"
					border="0" align="absbottom" alt="${key.delete}" /></a></td>
				</pms:AuthTag>

			</tr>
		</table>
		</div>
		<!--------------------------右边图标02----------------------------------->
		<div id="rightMeter" style="display:none">
		<table border="0" cellpadding="0" cellspacing="0" id="ico2">
			<tr>
			<pms:AuthTag authName="charge_charStoChoAction.do?method=initAddMeterCho">
				<td class="toolbarico"><a href="#" onclick="openNewMeter();"
					onfocus="this.blur()"><img src="${ctx}/images/ico_newfile.gif"
					border="0" align="absbottom" alt="${key.add}" /></a></td>
			</pms:AuthTag>
			<pms:AuthTag authName="charge_charStoChoAction.do?method=initEditMeterCho">
				<td class="toolbarico"><a href="#" onclick="openEditMeter();"
					onfocus="this.blur()"><img src="${ctx}/images/ico_amend.gif"
					border="0" align="absbottom" alt="${key.modify}" /></a></td>
			</pms:AuthTag>
			<pms:AuthTag authName="button.nopage.common.selectChangeStandenSelect.two">
				<td class="toolbarico"><a href="#" onClick="showDelete()"
					onFocus="this.blur()"><img src="${ctx}/images/ico_delete.gif"
					border="0" align="absbottom" alt="${key.delete}" /></a></td>
			</pms:AuthTag>
			</tr>
		</table>
		</div>
		<!--------------------------右边图标03----------------------------------->
		<div id="rightFixed" style="display:none">
		<table border="0" cellpadding="0" cellspacing="0" id="ico3">
			<tr>
			<pms:AuthTag authName="charge_charStoChoAction.do?method=initAddFixedCho">
				<td class="toolbarico"><a href="#" onclick="openNewFixed()"
					onfocus="this.blur()"><img src="${ctx}/images/ico_newfile.gif"
					border="0" align="absbottom" alt="${key.add}" /></a></td>
					</pms:AuthTag>
			<pms:AuthTag authName="charge_charStoChoAction.do?method=initEditFixedCho">
				<td class="toolbarico"><a href="#" onclick="openEditFixed()"
					onfocus="this.blur()"><img src="${ctx}/images/ico_amend.gif"
					border="0" align="absbottom" alt="${key.modify}" /></a></td>
			</pms:AuthTag>
			<pms:AuthTag authName="button.nopage.common.selectChangeStandenSelect.three">
				<td class="toolbarico"><a href="#" onClick="showDelete()"
					onFocus="this.blur()"><img src="${ctx}/images/ico_delete.gif"
					border="0" align="absbottom" alt="${key.delete}" /></a></td>
			</pms:AuthTag>
			</tr>
		</table>
		</div>
		<!--------------------------右边图标end----------------------------------->
		</td>
	</tr>

<tr>
	<td valign="top"><!--------------------------表格01----------------------------------->
	<div class="tab_bgline"><!--------列表页面---->
	<pms:tabPanel
		panelId="charStoCho" hasTop="false" iframeId="charStoChoList"
		defaultHeight="400px">

		<pms:tab tabId="charStoChoGeneralList"
			baseUrl="${ctx}/charge_charStoChoAction.do?method=initGenneralChoList"
			caption="${key.generalCharge}" rightDiv="rightGeneral"
			afterFunction="changeMethodName('queryGenneralChoList');clearSearch();">
		</pms:tab>

		<pms:tab tabId="charStoChoMeterList"
			baseUrl="${ctx}/charge_charStoChoAction.do?method=initMeterChoList"
			afterFunction="changeMethodName('queryMeterChoList');clearSearch();"
			caption="${key.meterCharge}" rightDiv="rightMeter">
		</pms:tab>

		<pms:tab tabId="charStoChoFixedList"
			baseUrl="${ctx}/charge_charStoChoAction.do?method=initFixedChoList"
			afterFunction="changeMethodName('queryFixedChoList');clearSearch();"
			caption="${key.fixedCharge}" rightDiv="rightFixed">
		</pms:tab>

	</pms:tabPanel></div>

	</td>
</tr>

</table>



</form>

</body>
</html>

